<?php

namespace App\Http\Controllers;

use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Routing\Controller as BaseController;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use App\Common\AliyunSms;
use App\Common\Base;

class UserController extends Controller
{
    /**
     * 实例化一个新的控制器实例。
     *
     * @return void
     */
    public function __construct()
    {
        $this->middleware('auth');

        $this->middleware('log')->only('index');

        $this->middleware('subscribed')->except('store');
    }
    public function index()
    {
    	echo "index";
    }
    /**
     * 2018-08-01
     * 
     * 刘家腾
     * 
     * 提醒商家发货
     *
     * @param      Request  $R      { parameter_description }
     *
     * @return     <type>   ( description_of_the_return_value )
     */
    public function remind(Request $R)
    {
        $postData  = $R->post();
        $usiness_info = Base::getBusiness_id($postData['business']);
        $code=$postData['batchcode'];
        $aliyunSms = new AliyunSms();
        $aliyunSms->code_type($code,'remind');
        return $aliyunSms->setRecNum($usiness_info['data']['business_phone']);

    }
}